//2.2 - Data Type Game - Dirk Henkemans and Mark Lee //Prima Publishing #include using namespace std; //introduces namespace std //plays the data type game int main( void ) { int intWarriors; double doubleWarriors; float floatWarriors; cout << "The village of the elves is being attacked\n" <<"by dragons."<< " In order to save them you \n"; cout << "must create each kind of data type warrior to\n" <<"defend the elven city." << endl << endl; cout << "How many int warriors do you want to send out?"; cin >> intWarriors; cout << endl <<"Luckily, each int warrior has a strength" << " of " << sizeof(intWarriors) << ", " << endl << "which almost defeats the blue dragons." << endl; cout << endl << "Quick! How many double warriors " << "should we send?"; cin >> doubleWarriors; cout << endl << doubleWarriors; cout << " double warriors attack the last few blue " << "dragons" << endl << "They kill " << sizeof(doubleWarriors) << " blue dragons." << " All of the blue dragons are now dead." << endl << endl; cout << "How many float warriors do you send out?"; cin >> floatWarriors; cout << endl << "Each of the "<< floatWarriors <<" float warriors shoots "; cout << sizeof(floatWarriors) << " arrows." << endl; cout << "This Is just enough to kill the green dragons." << endl << "Congratulations, you have saved " << "the elves!"; }